package 基础.代码块;

class Dog{
    String name;
    int age;
    static String color;
    {
        this.name = "大黄";
        this.age  = 1;
        Dog.color ="黄色";//静态变量
        System.out.println("这是实例代码块");
    }
    void show(){
        System.out.println("名字："+this.name+" 年龄:"+this.age+" 颜色："+this.color);
    }
}
public class 实例代码块 {
    public static void main(String[] args) {
        Dog dog = new Dog();
        dog.show();
    }
}
